/**
 * 
 */
package com.ibuonline.search.solr.dict.file.sougou;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.ibuonline.search.solr.dict.Dict;

/**
 * @author Liuye
 * 
 */
public class ScelDict extends Dict {

	private Map<String, List<String>> wordMap;

	public void setWordMap(Map<String, List<String>> wordMap) {
		this.wordMap = wordMap;
	}

	public Map<String, List<String>> getWordMap() {
		return wordMap;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ibuonline.solr.dict.file.Dict#getTerms()
	 */
	@Override
	public Set<String> getTerms() {
		if (super.getTerms().isEmpty()
				&& (wordMap != null && !wordMap.isEmpty())) {
			Collection<List<String>> termSet = wordMap.values();
			for (List<String> terms : termSet) {
				super.getTerms().addAll(terms);
			}
		}
		return super.getTerms();
	}
}
